﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//importamos
using System.Data.Entity.ModelConfiguration;
using CredisysTriunfadores.BusinessEntites.Acciones;
using System.ComponentModel.DataAnnotations.Schema; //el DatabaseGeneratedOption

namespace CredisysTriunfadores.Repository.Mapping
{
    public class AccionMap:EntityTypeConfiguration<Accion>
    {
        public AccionMap()
        {
            //Primary key y que sea auto-incrementable
            this.HasKey(ac => ac.Id);
            this.Property(ac => ac.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            //propiedades
            this.Property(ac => ac.Capital)
                .HasColumnType("decimal")
                .HasPrecision(9, 2)
                .IsRequired();
        }
    }
}
